from main import DIR,ENVIRON
import  yaml

class YamlRead:
    """yaml 配置文件的读取方法"""
    @staticmethod
    def env_config():
        """环境变量的读取"""
        with open(file=f'{DIR}/data/envConfig/{ENVIRON}/envConfig.yml', mode='r',encoding='utf-8') as f:
            return yaml.load(f, Loader = yaml.FullLoader)

    @staticmethod
    def api_config():
        """api变量的读取"""
        with open(file=f'{DIR}/data/apiConfig/apiConfig.yml', mode='r',encoding='utf-8') as f:
            return yaml.load(f, Loader = yaml.FullLoader)